Read Me - SimpleCocoaJavaMovie

This sample contains code showing how to use the NSMovieView and NSMovie Cocoa Java AppKit classes. The code attemps to duplicate the functionality of the standard QuickTime movie controller using the NSMovieView/NSMovie methods. In the model/controller/view paradigm, the sample defines a controller object, the MyMovieController class, to act as a mediator between the view objects and the model objects. The view objects consist of a main window which contains an NSMovieView object plus NSButtons for each of the play, step forward, etc. movie controller functions.

In the main window, clicking on the "step forward" button, for example, will in turn call the NSMovieView stepForward method to advance the movie by a frame. Clicking the "play" button will call the NSMovieView play method to begin playing the movie. A second click on the same button will stop the movie by calling the NSMovieView stop method. Another click on the same button will toggle back to "play" mode, again calling the NSMovieView play method. The code also makes use of a timer task to periodically check the play state of the movie and reset the "play" button state accordingly.


How To Use The Application

Launch the application, click the "play" button (the middle button with the ">") and the included movie file will begin playing in the window. Clicking again on the same button will toggle between the "play" and "stop" functions (just like the standard QuickTime movie controller). The other buttons implement the "go to beginning", "step backward", "step forward" and "go to end" movie controller functions.

Project Requirements

Mac OS X
Project Builder 1.0
QuickTime 5.0